Set the accessible states of the switcherList items by calling a
function instead of manipulating class-internal variables from outside
the class, which is considered bad practice.
The check whether the item at `_selectedIndex` exists can also be
removed since we always select a new index after an item was removed
(i.e. an app was closed) and destroy the alt-tab switcher right away if
no more items exist (see `SwitcherPopup._itemRemovedHandler`).
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167
},
});
this._thumbnails = null;
- if (this._switcherList._items[this._selectedIndex])
- this._switcherList._items[this._selectedIndex].remove_accessible_state(Atk.StateType.EXPANDED);
+ this._switcherList.removeAccessibleState(this._selectedIndex, Atk.StateType.EXPANDED);
}
_createThumbnails() {
},
});
- this._switcherList._items[this._selectedIndex].add_accessible_state(Atk.StateType.EXPANDED);
+ this._switcherList.addAccessibleState(this._selectedIndex, Atk.StateType.EXPANDED);
}
});
this.emit('item-removed', index);
}
+ addAccessibleState(index, state) {
+ this._items[index].add_accessible_state(state);
+ }
+
+ removeAccessibleState(index, state) {
+ this._items[index].remove_accessible_state(state);
+ }
+
_onItemClicked(index) {
this._itemActivated(index);
}